<?php

//apd_set_pprof_trace();
require_once('../includes/DB.class.php');
require_once('../includes/SmartyManager.class.php');
require_once('../includes/exceptions/AppExceptions.class.php');
require_once('../includes/SimpleTableExporter.class.php');

ini_set("max_execution_time",0);

$smarty = SmartyManager::getSmarty();

try{
	$query = "select * from little_main where certificationNumber is null or certificationNumber = '';";
	$facheNumber = array();
	$certificationCodification = array();
	$sequenceNumber = array();
	$manufactory = array();
	$authenticationMark = array();
	$steelNumber =  array();
	$size1 = array();
	$size2 = array();
	$size3 = array();
	$count = array();
	$unitWeight = array();
	$orderNumber = array();
	$orderSubitemNumber = array();
	$unitPrice = array();
	$materialNumber = array();
	$consignmentBatch = array();
	$sampleBatch = array();
	$purchaseNumber = array();
	$shipmentDate = array();
	$month = array();
	$vehicleNumber = array();
	$consignee = array();
	$remark = array();
	$filename = array();
	$uploadTime = array();
	
	DB::query($query);
	$result = DB::getResult();
	while($row = $result->fetch_assoc()){
			array_push($facheNumber, $row['facheNumber']);
			array_push($certificationCodification, $row['certificationCodification']);
			array_push($sequenceNumber, $row['sequenceNumber']);
			array_push($manufactory, $row['manufactory']);
			array_push($authenticationMark, $row['authenticationMark']);
			array_push($steelNumber, $row['steelNumber']);	
			array_push($size1, $row['size1']);
			array_push($size2, $row['size2']);
			array_push($size3, $row['size3']);
			array_push($count, $row['count']);
			array_push($unitWeight, $row['unitWeight']);			
			array_push($orderNumber, $row['orderNumber']);
			array_push($orderSubitemNumber, $row['orderSubitemNumber']);
			array_push($unitPrice,$row['unitPrice']);
			array_push($materialNumber, $row['materialNumber']);
			array_push($consignmentBatch, $row['consignmentBatch']);
			array_push($sampleBatch,$row['sampleBatch']);
			array_push($purchaseNumber,$row['purchaseNumber']);
			array_push($shipmentDate,$row['shipmentDate']);
			array_push($month,$row['month']);
			array_push($vehicleNumber, $row['vehicleNumber']);
			array_push($consignee, $row['consignee']);
			array_push($remark, $row['remark']);
			array_push($filename, $row['filename']);
			array_push($uploadTime, $row['uploadTime']);
	}
	
$smarty->assign(array(
			'facheNumber' 	=> 	$facheNumber,
			'certificationCodification' 		=> 	$certificationCodification,
			'sequenceNumber' 		=> 	$sequenceNumber,
			'manufactory' 		=> 	$manufactory,
			'authenticationMark' 		=> 	$authenticationMark,
			'steelNumber' 		=> 	$steelNumber,
			'size1' 		=> 	$size1,
			'size2' 		=> 	$size2,
			'size3' 		=> 	$size3,
			'count'	=>	$count,
			'unitWeight'		=>	$unitWeight,
			'orderNumber'		=>	$orderNumber,
			'orderSubitemNumber'		=>	$orderSubitemNumber,
			'unitPrice'		=>	$unitPrice,
			'materialNumber'		=>  $materialNumber,
			'consignmentBatch'	=>  $consignmentBatch,
			'sampleBatch'		=>  $sampleBatch,
			'purchaseNumber'	=>  $purchaseNumber,
			'shipmentDate'	=>  $shipmentDate,
			'month'	=>  $month,
			'vehicleNumber'	=>  $vehicleNumber,
			'consignee'	=>  $consignee,
			'remark'	=>  $remark,
			'filename'	=> $filename,
			'uploadTime' => $uploadTime
	));
	$smarty->display('certificationNumberNull.html');
}catch(Exception $e){
	$smarty = SmartyManager::getSmarty();
	$smarty->assign('errMsg', $e);
	$smarty->assign('errTitle', '查询数据库时出现错误');
	$smarty->display('error.html');
	die();
}
?>

